﻿using LightCAD.Core;
using SkiaSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LightCAD.Runtime
{
    public static class SkExtent
    {
        public static SKPoint ToSKPoint(this Vector2d point)
        {
            return new SKPoint((float)point.X, (float)point.Y);
        }
        public static Vector2d ToVector2d(this SKPoint point)
        {
            return new Vector2d(point.X, point.Y);
        }
        public static SKRect ToSKRect(this Box2d box)
        {
            return new SKRect( (float)box.LeftTop.X, (float)box.LeftTop.Y, (float)box.RightBottom.X, (float)box.RightBottom.Y);
        }
        public static Box2d ToBox2d(this SKRect rect)
        {
            return new Box2d(new Vector2d(rect.Left, rect.Top), new Vector2d(rect.Right, rect.Bottom));
        }

    }
}
